<?php
/**
 * Author: Traveler
 * Time  : 2021/10/12 21:59
 */

namespace app\service;


use app\model\IcafeWanModel;
use sunshine\basic\RestService;

class IcafeWanService extends RestService
{
    /**
     * IcafeWanService constructor.
     */
    public function __construct()
    {
        $this->model = new IcafeWanModel();
        $this->initialize();
    }

    /**
     * 初始化
     */
    public function initialize()
    {
        $this->queryConditions['with']   = ['isp'];
    }

    /**
     * 根据运营商id获取统计
     *
     * @param int $id
     * @return int
     */
    public function getCountByIsp(int $id): int
    {
        return $this->getCountByWhere(['isp_id' => $id]);
    }
}